# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>

pkgbase=lxappearance
pkgname=(lxappearance lxappearance-gtk3)
pkgver=0.6.3
pkgrel=4
pkgdesc='Feature-rich GTK+ theme switcher of the LXDE Desktop'
arch=('loong64' 'x86_64')
license=('GPL2')
url='https://wiki.lxde.org/en/LXAppearance'
depends=('gtk2' 'gtk3')
makedepends=('intltool' 'dbus-glib')
source=(https://downloads.sourceforge.net/lxde/$pkgbase-$pkgver.tar.xz)
sha256sums=('7222d858b8fef4b7967c42142d61e82ded6dd42dc5ef1d59caad775795928b38')

build() {
  # GTK+ 2 version
  [ -d gtk2 ] || cp -r $pkgbase-$pkgver gtk2
  cd gtk2
  ./configure --sysconfdir=/etc --prefix=/usr --enable-dbus
  make

  cd "$srcdir"
  # GTK+ 3 version
  [ -d gtk3 ] || cp -r $pkgbase-$pkgver gtk3
  cd gtk3
  ./configure --sysconfdir=/etc --prefix=/usr --enable-dbus --enable-gtk3
  make
}

package_lxappearance() {
  groups=('lxde')
  depends=('gtk2')

  cd gtk2
  make DESTDIR="$pkgdir" install
}

package_lxappearance-gtk3() {
  groups=('lxde-gtk3')
  pkgdesc+=' (GTK+ 3 version)'
  depends=('gtk3')
  conflicts=('lxappearance')

  cd gtk3
  make DESTDIR="$pkgdir" install
}
